home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu332 / 332src.arc / CHIPSEL.LST next >
File List  |  1990-05-02  |  40KB  |  681 lines

  1. Motorola 68000 Family Assembler                (1.0 ) Wed May 02 21:07:02 1990
  2.  
  3. M68332 BUSINESS CARD COMPUTER CHIP SELECT INIT
  4.  
  5. abs. rel.   LC   obj. code   source line
  6. ---- ----   ---- ---------   -----------
  7.    1    1   0000            |        TTL       M68332 BUSINESS CARD COMPUTER CHIP SELECT INIT
  8.    2    2   0000            |        OPT       P=68332             SETUP FOR 68332 CODE
  9.    3    3   0000            |        OPT       BRS                 SHORT BRANCHES PREFERED
  10.    4    4   0000            |
  11.    5    5   0000            |******************************************************************************
  12.    6    6   0000            |*** EXPORTED PORTION OF THE MODULE HEADER                                  ***
  13.    7    7   0000            |*V****************************************************************************
  14.    8    8   0000            |******************************************************************************
  15.    9    9   0000            |***                                                                        ***
  16.   10   10   0000            |*** MODULE :       CHIP SELECT INITIALIZATION                              ***
  17.   11   11   0000            |***                                                                        ***
  18.   12   12   0000            |*** ENVIRONMENT :  68332 Business Card Computer (BCC) Rev. A, B            ***
  19.   13   13   0000            |***                For M68332PFB Platform Board, Rev. A, B, C              ***
  20.   14   14   0000            |***                                                                        ***
  21.   15   15   0000            |***                NOTE:  BCC Rev. A + PFB Rev. A = Old System             ***
  22.   16   16   0000            |***                       BCC Rev. B + PFB Rev. B = New System             ***
  23.   17   17   0000            |***                                                                        ***
  24.   18   18   0000            |***                       PFB Rev. C is jumper selectable to be function-  ***
  25.   19   19   0000            |***                       ally equivalent to Rev. A or to Rev. B.          ***
  26.   20   20   0000            |***                                                                        ***
  27.   21   21   0000            |***                 ---- DO NOT MIX REV. A's WITH REV. B's! ----           ***
  28.   22   22   0000            |***                 ---- NO STACK USAGE (SUBR'S) ALLOWED!   ----           ***
  29.   23   23   0000            |***                                                                        ***
  30.   24   24   0000            |*** LANGUAGE :     68332 ASSEMBLY LANGUAGE                                 ***
  31.   25   25   0000            |***                                                                        ***
  32.   26   26   0000            |*** SUMMARY OF CONTENTS :                                                  ***
  33.   27   27   0000            |***     Determines BCC type (A or B) and initializes the appropriate chip  ***
  34.   28   28   0000            |***     selects using the corresponding values from the parameter area.    ***
  35.   29   29   0000            |***                                                                        ***
  36.   30   30   0000            |*** LINK REQUIREMENTS :                                                    ***
  37.   31   31   0000            |***   NOTES:                                                               ***
  38.   32   32   0000            |***     1.  Source equivalent copy of 332Bug parameter area for Motorola   ***
  39.   33   33   0000            |***         FREEWARE Bulletin Board System (BBS) to produce object         ***
  40.   34   34   0000            |***         equivalent code.  See REVISION HISTORY below for version nbr.  ***
  41.   35   35   0000            |***     2.  This source code can be freely used at no cost/obligation,     ***
  42.   36   36   0000            |***         i.e. it is PUBLIC DOMAIN software.  Please report any errors/  ***
  43.   37   37   0000            |***         additions to the SYSOP of the Motorola FREEWARE BBS.           ***
  44.   38   38   0000            |***     3.  Parameters which reference linker symbols (XREF/XDEF) will     ***
  45.   39   39   0000            |***         not be defined until link time, so the obj. code listed here   ***
  46.   40   40   0000            |***         will not match the actual EPROM code.                          ***
  47.   41   41   0000            |***                                                                        ***
  48.   42   42   0000            |******************************************************************************
  49.   43   43   0000            |*^****************************************************************************
  50.   44   44   0000            |*
  51.   45   45   0000            |         PAGE
  52.   46   46   0000            |*
  53.   47   47   0000            |******************************************************************************
  54.   48   48   0000            |*** INTERNAL PORTION OF THE MODULE HEADER                                  ***
  55.   49   49   0000            |******************************************************************************
  56.   50   50   0000            |***                                                                        ***
  57.   51   51   0000            |***   REVISION HISTORY (add changes to the top):                           ***
  58.   52   52   0000            |***                                                                        ***
  59.   53   53   0000            |***      DATE         AUTHOR               CHANGES                         ***
  60.   54   54   0000            |***   ----------  ---------------  -------------------------------------   ***
  61.   55   55   0000            |***    01/17/90   Peter S. Gilmour Initial version port to MS_DOS based    ***
  62.   56   56   0000            |***                                M68MASM from original source code.      ***
  63.   57   57   0000            |***                                Compatible with 332Bug version 1.01.    ***
  64.   58   58   0000            |***    05/02/90   Peter S. Gilmour Compatible with 332Bug version 1.02.    ***
  65.   59   59   0000            |******************************************************************************
  66.   60   60   0000            |*** XDEFS :                                                                ***
  67.   61   61   0000            |        XDEF    INIT_CS
  68.   62   62   0000            |***                                                                        ***
  69.   63   63   0000            |*** XREFS :                                                                ***
  70.   64   64   0000            |        XREF    PWR_TTL
  71.   65   65   0000            |        XREF    .RAMMCR
  72.   66   66   0000            |        XREF    .RAMBAR
  73.   67   67   0000            |        XREF    .CSBAR0,.CSBAR1,.CSBAR2,.CSBARBT
  74.   68   68   0000            |        XREF    CSBAR0$
  75.   69   69   0000            |***                                                                        ***
  76.   70   70   0000            |***   Local macros:                                                        ***
  77.   71   71   0000            |***                                                                        ***
  78.   72   72   0000            |SYSTEM   MACRO                         ! SETUP MONITOR SPACE
  79.   73   73   0000            |SECTD    SET       1                   ! DEFINE DATA SECTION
  80.   74   74   0000            |SECTP    SET       14                  ! DEFINE PROGRAM SECTION
  81.   75   75   0000            |         SECTION   SECTP               ! PUT USER INTO PROG. SECTION
  82.   76   76   0000            |         ENDM                          !
  83.   77   77   0000            |*
  84.   78   78   0000            |* Time delay macro
  85.   79   79   0000            |*   - allows bus capacitance to dissipate
  86.   80   80   0000            |*   - at least 3 words must be fetched to guarantee dissipation
  87.   81   81   0000            |*
  88.   82   82   0000            |T_DELAY MACRO
  89.   83   83   0000            |        NOP
  90.   84   84   0000            |        NOP
  91.   85   85   0000            |        NOP
  92.   86   86   0000            |        ENDM
  93.   87   87   0000            |
  94.   88   88   0000            |***
  95.   89   89   0000            |***   Local equates:
  96.   90   90   0000            |***
  97.   91   91        0000 0000  |OLD_BCC  EQU       0         Code ID for old BCC
  98.   92   92        0000 0001  |NEW_BCC  EQU       1         Code ID for new BCC
  99.   93   93   0000            |
  100.   94   94   0000            |*
  101.   95   95   0000            |*  For M68332 BCC and PFB.
  102.   96   96   0000            |*
  103.   97   97   0000            |*  NOTE: Unused upper address lines are specified as 1's so ABSOLUTE SHORT
  104.   98   98   0000            |*        addressing (sign extension) can be used.
  105.   99   99   0000            |*
  106.  100  100        0000 2700  |SR_VAL    EQU      $2700               status register initial value.
  107.  101  101   0000            |
  108.  102  102        0000 0000  |RAM_BASE  EQU      $0                  BCC RAM base address
  109.  103  103        0001 0000  |RAM_SIZE  EQU      $10000              BCC RAM size (bytes)
  110.  104  104        0006 0000  |ROM1_BASE EQU      $60000              BCC EPROM base address
  111.  105  105        0002 0000  |ROM1_SIZE EQU      $20000              BCC EPROM size (bytes)
  112.  106  106        0004 0000  |IRAM_BASE EQU      $40000
  113.  107  107        FFFF E800  |FPCP_BASE EQU      $FFFFE800           PFB MC68881/MC6882 base address
  114.  108  108   0000            |*                                      .  (Floating Point Co-Processor)
  115.  109  109        FFFF FA00  |SIM       EQU      $FFFFFA00           BCC M68332 System Integration Module base addr
  116.  110  110        FFFF FB00  |RAMCR     EQU      $FFFFFB00           BCC M68332 RAM Control Module base address
  117.  111  111        FFFF F800  |AUTO_BASE EQU      $FFFFF800           Autovector base address
  118.  112  112   0000            |
  119.  113  113        0000 0000  |LOCALRAM  EQU      RAM_BASE            base of local RAM
  120.  114  114        0000 4000  |SYSRAMSZ  EQU      $00004000           size of local RAM (for system use)
  121.  115  115        0001 0000  |LCLRAMMX  EQU      RAM_SIZE            max size of local RAM (for M68332 BCC)
  122.  116  116        0000 4000  |USRRAM    EQU      LOCALRAM+SYSRAMSZ   base of user RAM
  123.  117  117        0000 C000  |USRRAMSZ  EQU      LCLRAMMX-SYSRAMSZ   size of user RAM
  124.  118  118        0000 0000  |RAMSTART  EQU      LOCALRAM            alias for base of local RAM
  125.  119  119   0000            |
  126.  120  120        0006 0000  |LOCALROM  EQU      ROM1_BASE           base of local ROM (use PC rel refs!)
  127.  121  121        0001 0000  |LCLROMSZ  EQU      $00010000           size of local ROM used by 332Bug
  128.  122  122        0000 00FF  |ROMUNPGM  EQU      $FF                 unprogrammed state of a byte of EPROM
  129.  123  123        0000 00FF  |FILL.1    EQU      ROMUNPGM            fill value for 1 byte = BYTE
  130.  124  124        0000 FFFF  |FILL.2    EQU      FILL.1<<8+FILL.1    fill value for 2 bytes= WORD
  131.  125  125        FFFF FFFF  |FILL.4    EQU      FILL.2<<16+FILL.2   fill value for 4 bytes= LONG WORD
  132.  126  126   0000            |
  133.  127  127        0001 0000  |RAM2_BASE EQU      LOCALRAM+LCLRAMMX   Next RAM base address
  134.  128  128        0008 0000  |ROM2_BASE EQU      ROM1_BASE+ROM1_SIZE Next ROM base address
  135.  129  129   0000            | 
  136.  130  130        0000 0400  |VECTSIZ  EQU       $400                Vector table size
  137.  131  131        0000 1000  |USERLEN  EQU       $1000               user space reserved
  138.  132  132        0000 4000  |MEMINC   EQU       $4000               memory increment for 130's or EVM's
  139.  133  133        0000 2BFC  |STKLEN   EQU       MEMINC-USERLEN-VECTSIZ-4 size of bug/diag stack + static vars
  140.  134  134   0000            | 
  141.  135  135   0000            |*
  142.  136  136   0000            |* Interrupt levels & vectors
  143.  137  137   0000            |*
  144.  138  138        0000 0007  |ABORTLVL EQU       7                   abort level
  145.  139  139        0000 001F  |ABORTVEC EQU       31                  abort vector
  146.  140  140        0000 0007  |ACFAILVL EQU       7                   AC-Fail level
  147.  141  141        0000 0041  |ACFAILVC EQU       65                  AC-Fail vector
  148.  142  142        0000 0006  |TIMERLVL EQU       6                   timer level: M68332 periodic int. timer
  149.  143  143        0000 0042  |TIMERVEC EQU       66                  timer vector
  150.  144  144   0000            |
  151.  145  145   0000            |*
  152.  146  146   0000            |*  Setup Base Addresses:
  153.  147  147   0000            |*    1. A31-A24 must= 0  (MC68332 only uses A0-A23; rest are unused!)
  154.  148  148   0000            |*    2. A10-A0  must= 0  (for Base Address Register usage).
  155.  149  149   0000            |*
  156.  150  150        00FF F800  |ADDRMASK EQU       $00FFF800           Address mask (24-bits, A10-A0= 0)
  157.  151  151        0000 0000  |RAM      EQU       RAM_BASE&ADDRMASK   Setup Base Addresses
  158.  152  152        0006 0000  |ROM      EQU       ROM1_BASE&ADDRMASK  Setup Base Addresses
  159.  153  153        0001 0000  |RAM2     EQU       RAM2_BASE&ADDRMASK  Setup Base Addresses
  160.  154  154        0008 0000  |ROM2     EQU       ROM2_BASE&ADDRMASK  Setup Base Addresses
  161.  155  155        00FF E800  |FPCP     EQU       FPCP_BASE&ADDRMASK  Setup Base Addresses
  162.  156  156        0004 0000  |IRAM     EQU       IRAM_BASE&ADDRMASK  Setup Base Addresses
  163.  157  157        00FF F800  |AVEC_7   EQU       AUTO_BASE&ADDRMASK  Setup Base Addresses
  164.  158  158   0000            |
  165.  159  159        0000 0000  |CSBAR_XX EQU       $0000               Reset (unused) value for CSBARn
  166.  160  160        0000 0000  |CSOR_XX  EQU       $0000               Reset (unused) value for CSORn
  167.  161  161   0000            |
  168.  162  162        FFFF FB00  |RAMMCR   EQU       RAMCR+$00           RAM Module Configuration Register
  169.  163  163        FFFF FB04  |RAMBAR   EQU       RAMCR+$04           RAM Module Base Address/Status Register
  170.  164  164        FFFF FA04  |SYNCR    EQU       SIM+$04             Clock Synthesizer Control Register
  171.  165  165        0000 4000  |VCO_X    EQU       $4000               VCO Frequency Control Bit X value
  172.  166  166        FFFF FA20  |SYPCR    EQU       SIM+$20             System Protection Control Register
  173.  167  167        FFFF FA44  |CSPAR    EQU       SIM+$44             Chip Select Pin Assignment Register
  174.  168  168        FFFF FA48  |CSBARBT  EQU       SIM+$48             Chip Select Base Boot Register
  175.  169  169        FFFF FA4A  |CSORBT   EQU       SIM+$4A             Chip Select Option Boot Register
  176.  170  170        FFFF FA4C  |CSBAR0   EQU       SIM+$4C             Chip Select 0 Base Register
  177.  171  171        FFFF FA4E  |CSOR0    EQU       SIM+$4E             Chip Select 0 Option Register
  178.  172  172        FFFF FA50  |CSBAR1   EQU       SIM+$50             Chip Select 1 Base Register
  179.  173  173        FFFF FA52  |CSOR1    EQU       SIM+$52             Chip Select 1 Option Register
  180.  174  174        FFFF FA54  |CSBAR2   EQU       SIM+$54             Chip Select 2 Base Register
  181.  175  175        FFFF FA56  |CSOR2    EQU       SIM+$56             Chip Select 2 Option Register
  182.  176  176   0000            |
  183.  177  177   0000            |*
  184.  178  178   0000            |* Option Register Equates (CSORBT, CSORn):
  185.  179  179   0000            |*
  186.  180  180        0000 0000  |B2K      EQU       0                   2K    block size
  187.  181  181        0000 0001  |B8K      EQU       1                   8K    block size
  188.  182  182        0000 0002  |B16K     EQU       2                   16K   block size
  189.  183  183        0000 0003  |B64K     EQU       3                   64K   block size
  190.  184  184        0000 0004  |B128K    EQU       4                   128K  block size
  191.  185  185        0000 0005  |B256K    EQU       5                   256K  block size
  192.  186  186        0000 0006  |B512K    EQU       6                   512K  block size
  193.  187  187        0000 0007  |B1M      EQU       7                   1MB   block size
  194.  188  188        0000 0000  |ASYNC    EQU       $0000               Asynchronous mode
  195.  189  189        0000 8000  |SYNC     EQU       $8000               Synchronous  mode
  196.  190  190        0000 4000  |CS_UPPB  EQU       2*$2000             Upper byte
  197.  191  191        0000 2000  |CS_LOWB  EQU       1*$2000             Lower byte
  198.  192  192        0000 6000  |CS_BOTHB EQU       3*$2000             Both  bytes (upper or lower)
  199.  193  193        0000 0800  |CS_R     EQU       1*$800              Read
  200.  194  194        0000 1000  |CS_W     EQU       2*$800              Write
  201.  195  195        0000 1800  |CS_RW    EQU       3*$800              Read or write
  202.  196  196        0000 0000  |CS_AS    EQU       0*$400              Address Strobe (AS*)
  203.  197  197        0000 0400  |CS_DS    EQU       1*$400              Data    Strobe (DS*)
  204.  198  198        0000 000E  |CS_FAST  EQU       14                  Fast     termination DSACK*
  205.  199  199        0000 000F  |CS_EXT   EQU       15                  External termination DSACK*
  206.  200  200        0000 0040  |CS_WAIT  EQU       1*$40               Wait cycles for DSACK*
  207.  201  201        0000 0000  |CS_CSP   EQU       0*$10               CPU  space
  208.  202  202        0000 0010  |CS_USP   EQU       1*$10               User space
  209.  203  203        0000 0020  |CS_SSP   EQU       2*$10               Supervisor space
  210.  204  204        0000 0030  |CS_SUSP  EQU       3*$10               Supervisor/User space
  211.  205  205        0000 0002  |CS_LVL   EQU       1*$2                Interrupt priority level
  212.  206  206        0000 0001  |CS_AVEC  EQU       1                   Autovector enable
  213.  207  207   0000            |
  214.  208  208   0000            | 
  215.  209  209   0000            |******************************************************************************
  216.  210  210   0000            |*
  217.  211  211   0000            |        SYSTEM
  218.  212    1m       0000 0001  +SECTD    SET       1                   ! DEFINE DATA SECTION
  219.  213    2m       0000 000E  +SECTP    SET       14                  ! DEFINE PROGRAM SECTION
  220.  214    3m  0000            +         SECTION   SECTP               ! PUT USER INTO PROG. SECTION
  221.  215  212   0000            |
  222.  216  213   0000            |* Start Chip Select Initialization:
  223.  217  214   0000            |*
  224.  218  215   0000            |INIT_CS:
  225.  219  216   0000 46FC 2700  |        MOVE.W    #SR_VAL,SR            Ensure status register initialized.
  226.  220  217   0004            |
  227.  221  218   0004            |* Set up SYSTEM PROTECTION REGISTER:
  228.  222  219   0004            |*
  229.  223  220   0004 31FC 0006  |        MOVE.W    #6,SYPCR              Turn off cop, DBF: BERR=16 clocks.
  230.  223        0008 FA20       |
  231.  224  221   000A            |
  232.  225  222   000A            |* Now let's go to 16.7 MHZ:
  233.  226  223   000A            |*
  234.  227  224   000A 0078 4000  |        OR.W      #VCO_X,SYNCR          X-bit doubles the current speed!
  235.  227        000E FA04       |
  236.  228  225   0010            |
  237.  229  226   0010            |* Remap Internal Standby RAM Module per CONFIGURATION PARAMETER values:
  238.  230  227   0010            |*
  239.  231  228   0010 323B 0170  |        MOVE.W    ((.RAMBAR).L,PC),D1   Get RAM Array Base Addr. value (RAMBAR).
  240.  231        0014 0000 0000  |
  241.  232  229   0018 0801 0000  |        BTST      #0,D1                 .  (Bit 0= RAMDS bit)
  242.  233  230   001C            |   IF  <EQ>  THEN.S                     If RAM Array Disabled Flag = OFF, then
  243.  234    1s  001C 6710       +        BEQ.S   .1
  244.  235  231   001E 303B 0170  |        MOVE.W    ((.RAMMCR).L,PC),D0   .  Get RAM Module Config. Reg. value
  245.  235        0022 0000 0000  |
  246.  236  232   0026 31C0 FB00  |        MOVE.W    D0,RAMMCR             .  and put it in the register.
  247.  237  233   002A 31C1 FB04  |        MOVE.W    D1,RAMBAR             .  Put RAMBAR value into the register.
  248.  238  234   002E            |* NOTE:  RAMBAR can only be written once!
  249.  239  235   002E            |   ENDI
  250.  240    1s  002E            +.1:
  251.  241  236   002E            |
  252.  242  237   002E            |* Enable SHOW CYCLES and allow INTERRRUPT ARBITRATION at priority 15:
  253.  243  238   002E            |*
  254.  244  239   002E 0078 020F  |        OR.W      #$020F,SIM            Enable show cycles & external arb. @ 15
  255.  244        0032 FA00       |
  256.  245  240   0034 0278 DFFF  |        AND.W     #$DFFF,SIM            Clear FRZBM bit= when FREEZE bus moni-
  257.  245        0038 FA00       |
  258.  246  241   003A            |*                                       tor continues to operate as programmed.
  259.  247  242   003A            |
  260.  248  243   003A            |*
  261.  249  244   003A            |* Set up all Chip Selects as "chip selects" in case user's have connected h/w
  262.  250  245   003A            |* devices.  Otherwise, address lines would be toggling as program runs and
  263.  251  246   003A            |* possibly cause the devices to be enabled!
  264.  252  247   003A 21FC FFFF  |        MOVE.L    #$FFFFFFFF,CSPAR      All = chip selects, 16-bit port
  265.  252        003E FFFF FA44  |
  266.  253  248   0042            |*                                       .  (unused bits have no effect!)
  267.  254  249   0042            |
  268.  255  250   0042            |* Set up RAM and CSBOOT CHIP SELECTs to old BCC values:
  269.  256  251   0042            |*
  270.  257  252   0042 21FB 0170  |        MOVE.L    ((.CSBAR0).L,PC),CSBAR0
  271.  257        0046 0000 0000  |
  272.  257        004A FA4C       |
  273.  258  253   004C 21FB 0170  |        MOVE.L    ((.CSBAR1).L,PC),CSBAR1
  274.  258        0050 0000 0000  |
  275.  258        0054 FA50       |
  276.  259  254   0056 21FB 0170  |        MOVE.L    ((.CSBARBT).L,PC),CSBARBT
  277.  259        005A 0000 0000  |
  278.  259        005E FA48       |
  279.  260  255   0060            |
  280.  261  256   0060            |* Test for old BBC by enabling its onboard RAM and ROM.
  281.  262  257   0060            |* If RAM found, then
  282.  263  258   0060            |*   assume old BCC with old Platform Board
  283.  264  259   0060            |* else
  284.  265  260   0060            |*   assume new BCC with new Platform Board
  285.  266  261   0060            |* endif
  286.  267  262   0060            |* If board == old_BCC 
  287.  268  263   0060            |*   initialize chip selects for old BCC and old platform board
  288.  269  264   0060            |* else
  289.  270  265   0060            |*   initialize chip selects for new BCC and new platform board
  290.  271  266   0060            |* endif
  291.  272  267   0060            |*
  292.  273  268   0060            |* To find RAM:
  293.  274  269   0060            |*   ($0000) = $5AA5A55A
  294.  275  270   0060            |*   delay to allow bus capacitance to dissipate
  295.  276  271   0060            |*   if ($0000) == $5AA5A55A then
  296.  277  272   0060            |*     ($0000) = $A55A5AA5
  297.  278  273   0060            |*     delay to allow bus capacitance to dissipate
  298.  279  274   0060            |*     if ($0000) == $A55A5AA5 then
  299.  280  275   0060            |*       RAM found
  300.  281  276   0060            |*     endif
  301.  282  277   0060            |*   else
  302.  283  278   0060            |*      ($4000) = $5AA5A55A
  303.  284  279   0060            |*      delay to allow bus capacitance to dissipate
  304.  285  280   0060            |*      if ($4000) == $5AA5A55A then
  305.  286  281   0060            |*        ($4000) = $A55A5AA5
  306.  287  282   0060            |*        delay to allow bus capacitance to dissipate
  307.  288  283   0060            |*        if ($4000) == $A55A5AA5 then
  308.  289  284   0060            |*          RAM found
  309.  290  285   0060            |*        endif
  310.  291  286   0060            |*     endif
  311.  292  287   0060            |*  endif
  312.  293  288   0060            |*
  313.  294  289   0060            |
  314.  295  290   0060            |* NOTE:  By default at Power Up, CSBOOT responds to any address in the
  315.  296  291   0060            |*        range of $0-$FFFFF (block size= 1 MB) to select the Boot ROM.
  316.  297  292   0060            |*        Since the Boot ROM only uses address lines A0-A16 (128K), it
  317.  298  293   0060            |*        appears replicated thru the memory map at every even ROM size
  318.  299  294   0060            |*        ($20000) boundary as follows:
  319.  300  295   0060            |*           $00000, $20000, $40000, $60000, $80000, $A0000, $C0000, $E0000
  320.  301  296   0060            |*        Thus the power up reset vectors for the SP and PC are fetched from
  321.  302  297   0060            |*        locations $0-7 and the PC is set to the memory range where we will
  322.  303  298   0060            |*        be programming the Boot ROM to appear at via the chip selects.
  323.  304  299   0060            |*        When the programming occurs, there are no addressing "glitches"
  324.  305  300   0060            |*        because we stay at the same locations!
  325.  306  301   0060            |
  326.  307  302   0060 7001       |        MOVEQ.L   #NEW_BCC,D0
  327.  308  303   0062 223C 5AA5  |        MOVE.L    #$5AA5A55A,D1           NOTE:  D1 and D2 are inverse patterns!
  328.  308        0066 A55A       |
  329.  309  304   0068 243C A55A  |        MOVE.L    #$A55A5AA5,D2
  330.  309        006C 5AA5       |
  331.  310  305   006E 91C8       |        SUB.L     A0,A0                   Test loca. = $0000.
  332.  311  306   0070            |
  333.  312  307   0070 2081       |        MOVE.L    D1,(A0)
  334.  313  308   0072            |        T_DELAY
  335.  314    1m  0072 4E71       +        NOP
  336.  315    2m  0074 4E71       +        NOP
  337.  316    3m  0076 4E71       +        NOP
  338.  317  309   0078            |        IF.L  D1 <EQ> (A0)  THEN.S        If test loca. is good, then
  339.  318    1s  0078 B290       +        CMP.L   (A0),D1
  340.  319    2s  007A 6610       +        BNE.S   .2
  341.  320  310   007C 2082       |           MOVE.L    D2,(A0)
  342.  321  311   007E            |           T_DELAY
  343.  322    1m  007E 4E71       +        NOP
  344.  323    2m  0080 4E71       +        NOP
  345.  324    3m  0082 4E71       +        NOP
  346.  325  312   0084            |           IF.L  D2 <EQ> (A0)  THEN.S     .  If inverse is good, then
  347.  326    1s  0084 B490       +        CMP.L   (A0),D2
  348.  327    2s  0086 6602       +        BNE.S   .3
  349.  328  313   0088 7000       |              MOVEQ.L   #OLD_BCC,D0       .    Got RAM, so must be old BCC!
  350.  329  314   008A            |           ENDI
  351.  330    1s  008A            +.3:
  352.  331  315   008A            |        ELSE.S                            else maybe just 1 bad loca.
  353.  332    1s  008A 601E       +        BRA.S   .4
  354.  333    2s  008C            +.2:
  355.  334  316   008C 307C 4000  |           MOVE.W    #$4000,A0            .  Test loca. = $4000.
  356.  335  317   0090            |*------------------------------------------------------------------------------
  357.  336  318   0090            |* CAUTION:  In the above "MOVE.W #$XXXX,A0" do not use an address with the
  358.  337  319   0090            |*           sign bit set, e.g., $8000, because sign extension will cause a
  359.  338  320   0090            |*           BUS ERROR below and crash the system!
  360.  339  321   0090            |*------------------------------------------------------------------------------
  361.  340  322   0090 2081       |           MOVE.L    D1,(A0)
  362.  341  323   0092            |           T_DELAY
  363.  342    1m  0092 4E71       +        NOP
  364.  343    2m  0094 4E71       +        NOP
  365.  344    3m  0096 4E71       +        NOP
  366.  345  324   0098            |           IF.L  D1 <EQ> (A0)  THEN.S     .  If test loca. is good, then
  367.  346    1s  0098 B290       +        CMP.L   (A0),D1
  368.  347    2s  009A 660E       +        BNE.S   .5
  369.  348  325   009C 2082       |              MOVE.L    D2,(A0)
  370.  349  326   009E            |              T_DELAY
  371.  350    1m  009E 4E71       +        NOP
  372.  351    2m  00A0 4E71       +        NOP
  373.  352    3m  00A2 4E71       +        NOP
  374.  353  327   00A4            |              IF.L  D2 <EQ> (A0)  THEN.S  .    If inverse is good, then
  375.  354    1s  00A4 B490       +        CMP.L   (A0),D2
  376.  355    2s  00A6 6602       +        BNE.S   .6
  377.  356  328   00A8 7000       |                 MOVEQ.L   #OLD_BCC,D0    .      Got RAM, so must be old BCC.
  378.  357  329   00AA            |              ENDI
  379.  358    1s  00AA            +.6:
  380.  359  330   00AA            |           ENDI
  381.  360    1s  00AA            +.5:
  382.  361  331   00AA            |        ENDI
  383.  362    1s  00AA            +.4:
  384.  363  332   00AA            |
  385.  364  333   00AA 0C00 0000  |        CMP.B     #OLD_BCC,D0
  386.  365  334   00AE 6610       |        BNE.S     BCC_NEW                 Branch if old BCC not found!
  387.  366  335   00B0            |
  388.  367  336   00B0            |* Here for old BCC and old Platform board (see Rev. 1 schematics for each):
  389.  368  337   00B0            |*
  390.  369  338   00B0            |*  U1/U3 = 120 nsec RAM w/fast termination
  391.  370  339   00B0            |*  U2/U4 = ROM, but laid out wrong, so can only be used as 120 nsec RAM!
  392.  371  340   00B0            |*
  393.  372  341   00B0            |*   CSBOOT = BCC U4       332Bug EPROM
  394.  373  342   00B0            |*   CS0    = BCC U3       write enable for MSB=UPPER=EVEN ram
  395.  374  343   00B0            |*   CS1    = BCC U2       write enable for LSB=LOWER=ODD  ram
  396.  375  344   00B0            |*   CS2    = PFB U1/U3    read  enable for MSB/LSB=BOTH   rams
  397.  376  345   00B0            |*   CS3    = PFB U1       write enable for LSB=LOWER=ODD  ram
  398.  377  346   00B0            |*   CS4    = PFB U4       read  enable for MSB=UPPER=EVEN rom
  399.  378  347   00B0            |*   CS5    = PFB U2       read  enable for LSB=LOWER=ODD  rom
  400.  379  348   00B0            |*   CS6    = PFB U5       chip  enable for MC68881/882
  401.  380  349   00B0            |*   CS7    = <unused>
  402.  381  350   00B0            |*   CS8    = PFB          ABORT pushbutton autovector
  403.  382  351   00B0            |*   CS9    = <unused>
  404.  383  352   00B0            |*   CS10   = PFB U3       write enable for MSB=UPPER=EVEN ram
  405.  384  353   00B0            |*                         . cut/jump U3-27 from CS4 to CS10 required!
  406.  385  354   00B0            |*
  407.  386  355   00B0            |* Set up other CHIP SELECT ports (CS0,CS1,CSBOOT already done):
  408.  387  356   00B0            |*
  409.  388  357   00B0 41FB 0170  |BCC_OLD LEA       ((.CSBAR2).L,PC),A0         Point to old CS2 entry.
  410.  388        00B4 0000 0000  |
  411.  389  358   00B8 43F8 FA54  |        LEA       CSBAR2,A1               Point to corresponding SIM reg.
  412.  390  359   00BC 7008       |        MOVEQ.L   #(10-2+1)-1,D0          Set count to do CS2-CS10.
  413.  391  360   00BE            |*                                         .  ("-1" for DBRA loop below!)
  414.  392  361   00BE 600E       |        BRA.S     CS_COM                  Go to common init routine!
  415.  393  362   00C0            |
  416.  394  363   00C0            |
  417.  395  364   00C0            |* Here for new BCC and new Platform board (see Rev. 2 schematics for each):
  418.  396  365   00C0            |*
  419.  397  366   00C0            |*  U1/U3 = 120 nsec RAM w/fast termination
  420.  398  367   00C0            |*  U2/U4 = 250 nsec ROM (or jumper selectable as RAM)
  421.  399  368   00C0            |*
  422.  400  369   00C0            |*   CSBOOT = BCC U4       332Bug EPROM
  423.  401  370   00C0            |*   CS0    = BCC U3       write enable for MSB=UPPER=EVEN ram
  424.  402  371   00C0            |*   CS1    = BCC U2       write enable for LSB=LOWER=ODD  ram
  425.  403  372   00C0            |*   CS2    = BCC U3/U2    read  enable for MSB/LSB=BOTH   rams
  426.  404  373   00C0            |*   CS3    = <unused>
  427.  405  374   00C0            |*   CS4    = PFB          ABORT pushbutton autovector
  428.  406  375   00C0            |*   CS5    = PFB U5       chip  enable for MC68881/882
  429.  407  376   00C0            |*                         . cut/jump U5-J3 from CS2 to CS5 required!
  430.  408  377   00C0            |*   CS6    = PFB U2       read  enable for LSB=LOWER=ODD  rom
  431.  409  378   00C0            |*   CS7    = PFB U4       read  enable for MSB=UPPER=EVEN rom
  432.  410  379   00C0            |*   CS8    = PFB U1/U3    read  enable for MSB/LSB=BOTH   rams
  433.  411  380   00C0            |*   CS9    = PFB U1       write enable for LSB=LOWER=ODD  ram
  434.  412  381   00C0            |*   CS10   = PFB U3       write enable for MSB=UPPER=EVEN ram
  435.  413  382   00C0            |*
  436.  414  383   00C0            |* Set up all CHIP SELECT ports (CSBOOT already done):
  437.  415  384   00C0            |*
  438.  416  385   00C0 41FB 0170  |BCC_NEW LEA       ((CSBAR0$).L,PC),A0     Point to new CS0 entry.
  439.  416        00C4 0000 0000  |
  440.  417  386   00C8 43F8 FA4C  |        LEA       CSBAR0,A1               Point to corresponding SIM reg.
  441.  418  387   00CC 700A       |        MOVEQ.L   #(10-0+1)-1,D0          Set count to do CS0-CS10.
  442.  419  388   00CE            |*                                         .  ("-1" for DBRA loop below!)
  443.  420  389   00CE            |
  444.  421  390   00CE            |* Common CHIP SELECTS initialization routine:
  445.  422  391   00CE            |*   A0.L = chip select configuration table entry (base addr)
  446.  423  392   00CE            |*   A1.L = corresponding SIM register
  447.  424  393   00CE            |*   D0.W = number of chip selects -1 to be initialized
  448.  425  394   00CE            |*
  449.  426  395   00CE 22D8       |CS_COM  MOVE.L    (A0)+,(A1)+   Init. SIM base addr + option register.
  450.  427  396   00D0 51C8 FFFC  |        DBRA      D0,CS_COM     Continue until all regs init'ed.
  451.  428  397   00D4            |
  452.  429  398   00D4 60FF 0000  |        BRA.L     PWR_TTL       Return to Power On Branch Vector
  453.  429        00D8 0000       |
  454.  430  399   00DA            |        END
  455.  430 lines assembled
  456.  
  457. symbol table:
  458. symbol name       attrib.  section    value
  459. -----------       -------  -------    -----
  460. INIT_CS           .text    14         0x0
  461.      @218 @61
  462. PWR_TTL           xref                 
  463.      429 @64
  464. .RAMMCR           xref                 
  465.      235 @65
  466. .RAMBAR           xref                 
  467.      231 @66
  468. .CSBAR0           xref                 
  469.      257 @67
  470. .CSBAR1           xref                 
  471.      258 @67
  472. .CSBAR2           xref                 
  473.      388 @67
  474. .CSBARBT          xref                 
  475.      259 @67
  476. CSBAR0$           xref                 
  477.      416 @68
  478. SYSTEM            macro                
  479.      211
  480. T_DELAY           macro                
  481.      349 341 321 313
  482. OLD_BCC           abs.                0x0
  483.      364 356 328 @91
  484. NEW_BCC           abs.                0x1
  485.      307 @92
  486. SR_VAL            abs.                0x2700
  487.      219 @100
  488. RAM_BASE          abs.                0x0
  489.      151 113 @102
  490. RAM_SIZE          abs.                0x10000
  491.      115 @103
  492. ROM1_BASE         abs.                0x60000
  493.      152 128 120 @104
  494. ROM1_SIZE         abs.                0x20000
  495.      128 @105
  496. IRAM_BASE         abs.                0x40000
  497.      156 @106
  498. FPCP_BASE         abs.                0xffffe800
  499.      155 @107
  500. SIM               abs.                0xfffffa00
  501.      245 244 175 174 173 172 171 170 169 168
  502.      167 166 164 @109
  503. RAMCR             abs.                0xfffffb00
  504.      163 162 @110
  505. AUTO_BASE         abs.                0xfffff800
  506.      157 @111
  507. LOCALRAM          abs.                0x0
  508.      127 118 116 @113
  509. SYSRAMSZ          abs.                0x4000
  510.      117 116 @114
  511. LCLRAMMX          abs.                0x10000
  512.      127 117 @115
  513. USRRAM            abs.                0x4000
  514.      @116
  515. USRRAMSZ          abs.                0xc000
  516.      @117
  517. RAMSTART          abs.                0x0
  518.      @118
  519. LOCALROM          abs.                0x60000
  520.      @120
  521. LCLROMSZ          abs.                0x10000
  522.      @121
  523. ROMUNPGM          abs.                0xff
  524.      123 @122
  525. FILL.1            abs.                0xff
  526.      124 124 @123
  527. FILL.2            abs.                0xffff
  528.      125 125 @124
  529. FILL.4            abs.                0xffffffff
  530.      @125
  531. RAM2_BASE         abs.                0x10000
  532.      153 @127
  533. ROM2_BASE         abs.                0x80000
  534.      154 @128
  535. VECTSIZ           abs.                0x400
  536.      133 @130
  537. USERLEN           abs.                0x1000
  538.      133 @131
  539. MEMINC            abs.                0x4000
  540.      133 @132
  541. STKLEN            abs.                0x2bfc
  542.      @133
  543. ABORTLVL          abs.                0x7
  544.      @138
  545. ABORTVEC          abs.                0x1f
  546.      @139
  547. ACFAILVL          abs.                0x7
  548.      @140
  549. ACFAILVC          abs.                0x41
  550.      @141
  551. TIMERLVL          abs.                0x6
  552.      @142
  553. TIMERVEC          abs.                0x42
  554.      @143
  555. ADDRMASK          abs.                0xfff800
  556.      157 156 155 154 153 152 151 @150
  557. RAM               abs.                0x0
  558.      @151
  559. ROM               abs.                0x60000
  560.      @152
  561. RAM2              abs.                0x10000
  562.      @153
  563. ROM2              abs.                0x80000
  564.      @154
  565. FPCP              abs.                0xffe800
  566.      @155
  567. IRAM              abs.                0x40000
  568.      @156
  569. AVEC_7            abs.                0xfff800
  570.      @157
  571. CSBAR_XX          abs.                0x0
  572.      @159
  573. CSOR_XX           abs.                0x0
  574.      @160
  575. RAMMCR            abs.                0xfffffb00
  576.      236 @162
  577. RAMBAR            abs.                0xfffffb04
  578.      237 @163
  579. SYNCR             abs.                0xfffffa04
  580.      227 @164
  581. VCO_X             abs.                0x4000
  582.      227 @165
  583. SYPCR             abs.                0xfffffa20
  584.      223 @166
  585. CSPAR             abs.                0xfffffa44
  586.      252 @167
  587. CSBARBT           abs.                0xfffffa48
  588.      259 @168
  589. CSORBT            abs.                0xfffffa4a
  590.      @169
  591. CSBAR0            abs.                0xfffffa4c
  592.      417 257 @170
  593. CSOR0             abs.                0xfffffa4e
  594.      @171
  595. CSBAR1            abs.                0xfffffa50
  596.      258 @172
  597. CSOR1             abs.                0xfffffa52
  598.      @173
  599. CSBAR2            abs.                0xfffffa54
  600.      389 @174
  601. CSOR2             abs.                0xfffffa56
  602.      @175
  603. B2K               abs.                0x0
  604.      @180
  605. B8K               abs.                0x1
  606.      @181
  607. B16K              abs.                0x2
  608.      @182
  609. B64K              abs.                0x3
  610.      @183
  611. B128K             abs.                0x4
  612.      @184
  613. B256K             abs.                0x5
  614.      @185
  615. B512K             abs.                0x6
  616.      @186
  617. B1M               abs.                0x7
  618.      @187
  619. ASYNC             abs.                0x0
  620.      @188
  621. SYNC              abs.                0x8000
  622.      @189
  623. CS_UPPB           abs.                0x4000
  624.      @190
  625. CS_LOWB           abs.                0x2000
  626.      @191
  627. CS_BOTHB          abs.                0x6000
  628.      @192
  629. CS_R              abs.                0x800
  630.      @193
  631. CS_W              abs.                0x1000
  632.      @194
  633. CS_RW             abs.                0x1800
  634.      @195
  635. CS_AS             abs.                0x0
  636.      @196
  637. CS_DS             abs.                0x400
  638.      @197
  639. CS_FAST           abs.                0xe
  640.      @198
  641. CS_EXT            abs.                0xf
  642.      @199
  643. CS_WAIT           abs.                0x40
  644.      @200
  645. CS_CSP            abs.                0x0
  646.      @201
  647. CS_USP            abs.                0x10
  648.      @202
  649. CS_SSP            abs.                0x20
  650.      @203
  651. CS_SUSP           abs.                0x30
  652.      @204
  653. CS_LVL            abs.                0x2
  654.      @205
  655. CS_AVEC           abs.                0x1
  656.      @206
  657. SECTD             abs.                0x1
  658.      @212
  659. SECTP             abs.                0xe
  660.      214 @213
  661. .1                .text    14         0x2e
  662.      @240 234
  663. .2                .text    14         0x8c
  664.      @333 319
  665. .3                .text    14         0x8a
  666.      @330 327
  667. .4                .text    14         0xaa
  668.      @362 332
  669. .5                .text    14         0xaa
  670.      @360 347
  671. .6                .text    14         0xaa
  672.      @358 355
  673. BCC_NEW           .text    14         0xc0
  674.      @416 365
  675. BCC_OLD           .text    14         0xb0
  676.      @388
  677. CS_COM            .text    14         0xce
  678.      427 @426 392
  679. .text             section  14          
  680. 110 symbols
  681.